var _bindFun_ = function (el, value) {
  let isEmpty = Object.isNullOrEmpty(value)
  if (isEmpty) {
    value = '--'
  }
  value = isEmpty ? '--' : value
  switch (el.tagName.toLowerCase()) {
    case 'input':
    case 'textarea':
      el.value = value
      break

    default:
      if (!isEmpty) {
        value = value + el.orgHTML
      }
      el.innerHTML = value
      break
  }
}

Vue.directive('content', {
  bind: (el, binding, vnode) => {
    el.orgHTML = el.innerHTML
  },
  update: (el, binding) => {
    _bindFun_(el, binding.value)
  },
  unbind: (el, binding) => {
    delete el.orgHTML
  }
})
